

project(guiframe)

find_package(Qt5 COMPONENTS Widgets LinguistTools REQUIRED)

#QT5_CREATE_TRANSLATION(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} guiframe_en.ts) 
file(GLOB_RECURSE  SRCS CONFIGURE_DEPENDS ./*.cpp)
source_group_by_dir(SRCS)

add_library(${PROJECT_NAME} SHARED
     ${SRCS}
    # ${QM_FILES}
	 res/guiframe.qrc
)

#add_custom_command(TARGET ${PROJECT_NAME}
#       POST_BUILD
#        COMMAND "${CMAKE_COMMAND}" -E copy
#               "${QM_FILES}"
#               "$<TARGET_FILE_DIR:guiframe>/localization/")

if(WINDOWS)
    target_compile_options(${PROJECT_NAME} PRIVATE -DS_GUIFRAME_DLL -DUSE_QB)
elseif (LINUX)
    target_compile_options(${PROJECT_NAME} PRIVATE -DS_GUIFRAME_DLL)
elseif (MACOS)
    target_compile_options(${PROJECT_NAME} PRIVATE -DS_GUIFRAME_DLL)
endif()

target_link_libraries(${PROJECT_NAME} Qt::Widgets core widgets uam qbkernel)
